﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace APACWP8.View
{
    public partial class PanoramaPage3 : PhoneApplicationPage
    {
        public PanoramaPage3()
        {
            InitializeComponent();
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            CheckOrientation(LayoutRoot);
        }
        private void CheckOrientation(Grid content)
        {

            if ((Orientation & PageOrientation.Portrait) == (PageOrientation.Portrait))
            {
                content.Margin = new Thickness(0, 0, 0, 0);
            }
            else if ((Orientation & PageOrientation.LandscapeLeft) == (PageOrientation.LandscapeLeft))
            {
                content.Margin = new Thickness(0, 0, 36, 0);
            }
            else if ((Orientation & PageOrientation.LandscapeRight) == (PageOrientation.LandscapeRight))
            {
                content.Margin = new Thickness(36, 0, 0, 0);
            }
        }
        private async void Image_Tap_4(object sender, System.Windows.Input.GestureEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("http://mspolicy/CORPORATEFUNCTIONS/PROCUREMENT/PurchasingSpending/Pages/default.aspx"));
        }

        private async void TextBlock_Tap_6(object sender, System.Windows.Input.GestureEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("https://microsoft.sharepoint.com/sites/mspolicy/CentralizedFunctions/Finance/PROCUREMENT/PurchasingSpending/5PayingPurchasing/Pages/PROCUR 5 1 Purchase Order.aspx"));
        }

        private async void TextBlock_Tap_1(object sender, System.Windows.Input.GestureEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("https://microsoft.sharepoint.com/sites/mspolicy/CentralizedFunctions/Finance/PROCUREMENT/PurchasingSpending/3ContractsNegotiations/Pages/PROCUR 3 3 Legal Review of Vendor Transactions.aspx"));
        }

        private async void TextBlock_Tap_2(object sender, System.Windows.Input.GestureEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("https://microsoft.sharepoint.com/sites/mspolicy/CentralizedFunctions/Finance/PROCUREMENT/PurchasingSpending/2BiddingRFxs/Pages/PROCUR 2 1 GPG Review Required.aspx"));
        }

        private async void TextBlock_Tap_3(object sender, System.Windows.Input.GestureEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("https://microsoft.sharepoint.com/sites/mspolicy/CentralizedFunctions/Finance/PROCUREMENT/PurchasingSpending/5PayingPurchasing/Pages/PROCUR 5 8 Vendor Prepayments.aspx"));
        }

        private async void Image_Tap_1(object sender, System.Windows.Input.GestureEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("https://microsoft.sharepoint.com/sites/mspolicy/CentralizedFunctions/Finance/PROCUREMENT/PurchasingSpending/5PayingPurchasing/Pages/PROCUR 5 9 3rd Party Payments.aspx"));
        }

        private async void Image_Tap_2(object sender, System.Windows.Input.GestureEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("http://sharepoint/sites/3PPPortal/Shared Documents/Business Process and Requirements/3PP Step-by-step Compliance Checklist.docx"));
        }

        private async void Image_Tap_3(object sender, System.Windows.Input.GestureEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("mailto:Ask3PP@microsoft.com"));
        }

        private async void TextBlock_Tap_4(object sender, System.Windows.Input.GestureEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("http://sharepoint/sites/3PPPortal/_layouts/WordViewer.aspx?id=/sites/3PPPortal/Shared Documents/Business Process and Requirements/Country List.docx&Source=http://sharepoint/sites/3PPPortal/Shared%2520Documents/Forms/AllItems.aspx?RootFolder%3D%252Fsites%252F3PPPortal%252FShared%2520Documents%252FBusiness%2520Process%2520and%2520Requirements%26FolderCTID%3D0x0120002A8FB2CC9A7D4E4B9E393EB7F7EE399F&DefaultItemOpen=1"));
        }

        private async void TextBlock_Tap_5(object sender, System.Windows.Input.GestureEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("https://microsoft.sharepoint.com/sites/mspolicy/CentralizedFunctions/Finance/PROCUREMENT/PurchasingSpending/5PayingPurchasing/Pages/PROCUR 5 9 3rd Party Payments.aspx"));
        }
        private void SettingClick_Click(object sender, EventArgs e)
        {
            App.RootFrame.Navigate(new Uri("/View/SettingPage.xaml", UriKind.Relative));
        }

        private void SearchClick_Click(object sender, EventArgs e)
        {
            App.RootFrame.Navigate(new Uri("/View/SearchPage.xaml", UriKind.Relative));
        }

        private async void Hyperlink_Click(object sender, RoutedEventArgs e)
        {
              await Windows.System.Launcher.LaunchUriAsync(new Uri("http://sharepoint/sites/smartbuy/SitePages/Home.aspx"));
        }

        private async void Hyperlink_Click_1(object sender, RoutedEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("http://myorder/Home.aspx"));

        }

        private async void Hyperlink_Click_2(object sender, RoutedEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("http://mspolicy/CORPORATEFUNCTIONS/PROCUREMENT/PurchasingSpending/Pages/default.aspx"));
        }
        private async void TextBlock_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("https://microsoft.sharepoint.com/sites/mspolicy/CentralizedFunctions/Finance/PROCUREMENT/PurchasingSpending/5PayingPurchasing/Pages/PROCUR 5 1 Purchase Order.aspx"));
        }

        private async void TextBlock_Tap_7(object sender, System.Windows.Input.GestureEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("https://microsoft.sharepoint.com/sites/mspolicy/CentralizedFunctions/Finance/PROCUREMENT/PurchasingSpending/3ContractsNegotiations/Pages/PROCUR 3 6 Signature Policy for Vendor Agreements.aspx"));
        }

        private async void TextBlock_Tap_8(object sender, System.Windows.Input.GestureEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("https://microsoft.sharepoint.com/teams/3rdPartyPayments/_layouts/15/WopiFrame.aspx?sourcedoc=%7bA92BA420-B796-4657-A047-5D0B7333A5FA%7d&file=Country List.docx&action=default"));
        }
    }
}